package sketch.specs;

import java.util.List;

import sketch.main.GeneratingTests;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class ValueExpansionByDeclarationTest extends TestCase {
	
	public static Test suite() {
		return new TestSuite(ValueExpansionByDeclarationTest.class);
	}
	
	
	
	public void testGeneratingTests() {
		//the test sketch file
		String testSketchFile = "./testfiles/sketch/specs/Z_Sketch_ValueExpansion.java";
		
		//to output the expanded tests in a specified place
		String outputFileDir = "./testfiles/sketch/specs/autogenerated/";
		String packageName = "sketch.specs.autogenerated";
		String outputClassName = "ValueExpansionByIntroduction";
		
		SketchedMethodsCreator creator = new SketchedMethodsCreator(testSketchFile);
		List<SketchedMethodDeclaration> sketchedMethods = creator.createSketchedMethodList();
		
		//we only have two test sketches
		assertEquals(2, sketchedMethods.size());
		
		GeneratingTests.generateTestsAndWriteToFile(sketchedMethods, creator.getUnit(),
				outputFileDir, packageName, outputClassName);
	}
}
